home *** CD-ROM | disk | FTP | other *** search
- package asp.wizard;
-
- import asp.netobjects.nfx.wizard.Wizard;
- import asp.util.EResourceUtil;
- import asp.util.ResourceUtil;
- import asp.wizard.util.NfxUtil;
- import asp.wizard.util.UiUtil;
- import com.netobjects.nfc.api.ApplicationComp;
- import com.netobjects.nfc.api.DNode;
- import com.netobjects.nfc.api.DSiteView;
- import com.sun.java.swing.JFrame;
- import com.sun.java.swing.UIManager;
- import java.awt.Component;
- import java.awt.Container;
- import java.awt.Dialog;
-
- public class AspWizard extends ApplicationComp {
- private static final String MSG_STATUS_CHECKINGCOMP = "msg.checkingcomp";
- private static final String MSG_STATUS_INITWIZWIN = "msg.initwizwindow";
- private static final String MSG_STATUS_PRELOADCLASS = "msg.preloadclasses";
- private static final String MSG_STATUS_INITWIZINTERNAL = "msg.initwizinternal";
- private static final String TITLE_LOADING_WIS = "title.loadingwiz";
-
- public void onEnable(DSiteView dsv) {
- String origLaf = UIManager.getLookAndFeel().getClass().getName();
- ResourceUtil ru = null;
- AspWizardExceptionHandler aweh = new AspWizardExceptionHandler((Container)null);
- ProgressStatus ps = null;
-
- try {
- UiUtil.lafSetup();
-
- try {
- ru = ResourceUtil.getResourceUtil("asp.wizard.res", this.getClass());
- } catch (EResourceUtil e) {
- aweh.handleException(e);
- return;
- }
-
- ps = ProgressStatus.getInstance();
- ((Dialog)ps).setTitle(ru.getString("title.loadingwiz"));
- ps.reset();
- ((Component)ps).setVisible(true);
- ps.setText(ru.getString("msg.checkingcomp"));
- DNode currentNode = new DNode();
- if (NfxUtil.componentsInstalled(currentNode)) {
- ps.setValue(30);
- ps.setText(ru.getString("msg.initwizwindow"));
- JFrame f = WizardManager.createMainFrame();
- ps.setValue(50);
- ps.setText(ru.getString("msg.preloadclasses"));
-
- try {
- Class.forName("asp.wizard.util.OdbcDsnRetriever");
- } catch (ClassNotFoundException e) {
- aweh.handleException(e);
- return;
- }
-
- ps.setValue(80);
- ps.setText(ru.getString("msg.initwizinternal"));
- WizardManager wm = new WizardManager(f, (String)null, (String)null, 540, 400, new AspWizardExceptionHandler(f));
- wm.setDSiteView(dsv);
- ps.setValue(100);
- ((Component)ps).setVisible(false);
- ((Dialog)ps).setTitle("");
- ((Wizard)wm).setVisible(true);
- if (wm.isFinished()) {
- wm.processDefPages();
- }
-
- }
- } finally {
- if (ps != null && ((Component)ps).isVisible()) {
- ((Component)ps).setVisible(false);
- }
-
- UiUtil.lafRestore();
- }
- }
- }
-